package 题目集.前缀和.二维前缀和;

//https://vjudge.net.cn/contest/613789#problem/D

import java.util.Scanner;

/**
 * 二维前缀和枚举
 */
public class 赈灾 {
    static long[][] pre;
    static int n;
    static double res= 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        pre = new long[n + 1][n + 1];
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                pre[i][j] = sc.nextInt() + pre[i - 1][j] + pre[i][j - 1] - pre[i - 1][j - 1];
            }
        }
        for (int i = 2; i <= n; i++) {
            for (int j = 2; j <= n; j++) {
                long cur=pre[i][j]-pre[i-2][j]-pre[i][j-2]+pre[i-2][j-2];    //当前2*2区域的和
                double avg=cur/4.0; //平均值
                res=Math.max(res,avg);
            }
        }
        System.out.println(String.format("%.2f",res));
    }
}
